-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow ptime SDP element to accept float type values #14
base: master
Are you sure you want to change the base?
Conversation
allow SDP ptime variable to accept float values
@ibc Here is a proposed change for ptime element in sdp. Thanks! |
Thanks :) BTW have you run tests? may be you could modify some existing test SDP by adding a ptime with float value and then check in in |
Yes, haven't got to that yet, will try to add this in as soon as I get a chance :) |
Note tha Travis CI is failing due to this change: https://travis-ci.com/github/ibc/libsdptransform/jobs/310698468#L691 Somehow I expected this. The problem is that this PR forces ptime to be printed as float even if it was an integer. Example: IMHO it's critical that we represent it as an integer ( BTW: why this change? - "ptime:%d"
+ "ptime:%s"
I understand it cannot be |
Yeah, I noticed the writer will force a decimal place as well. I wanted to make it something similar to the "framerate" element as it handles similar inputs so I used that as a point of reference.. And yes, ideally we'd want to not have a floating point representation if not needed. I'm not quite sure how one would go about ensuring that atm :) |
You are right, sorry. Maybe the same issue happens in |
Note that, instead of |
In such a #include <sstream> // std::istringstream
#include <ios> // std::noskipws
bool isFloat(const std::string& str)
{
std::istringstream iss(str);
float f;
iss >> std::noskipws >> f;
return iss.eof() && !iss.fail();
} |
No description provided.